package com.cyz.springdemo.Controller.meituan;

import com.alibaba.fastjson.JSONObject;
import com.cyz.springdemo.model.meituan.OrderDetailParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @program: springdemo
 * @description: 美团消息推送接收
 * @author: wangjie
 * @create: 2019-10-09 09:28
 **/
@RestController
@RequestMapping(value = "/api/thirt_party")
public class AcceptController {

    @Autowired
    private RedisTemplate<String, String> redisTemplate;

    @RequestMapping(value = "/newOrder",method = RequestMethod.POST)
    public Object responseNewOrder(OrderDetailParam orderDetailParam){

        JSONObject orderJson = new JSONObject();
        orderJson.put("orderDetailParam",orderDetailParam);

        //redisTemplate.opsForList().rightPush("newOrder",orderJson.toJSONString());

        Map<String,String> resultMap = new HashMap<>();
        resultMap.put("data","ok");
        return resultMap;
    }
}
